﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations;
using TestRootBaseData.Service.Model;


namespace TestRootBaseData.Service.Model.ModelConfiguration
{
    class PersonConfiguration
    : EntityTypeConfiguration<Person>
    {

        public PersonConfiguration()
        {
           // HasKey(c => c.Id)
           //.Property(c => c.Id)
           //.HasDatabaseGeneratedOption(.Identity);                 
                  
            
            ToTable("Person");
            HasMany(c=>c.Children).WithOptional().HasForeignKey(c=>c.ParentId).WillCascadeOnDelete(false);

        
}
    }
}

